<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Organization.aspx.cs" Inherits="Admin_Organization" Title="APM - Organization" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="organization">
        <ul id="path">
            <li><a href="../Home.aspx">Home</a> &gt;</li>
            <li>Administration &gt;</li>
            <li>Organization</li>
        </ul>
        <h3 class="organization"><span>Organizations</span></h3>
        <div id="content">
            <p>
            </p>
            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td valign="top" style="width: 215px">
                        <font style="font-weight: bold;">Existing Organizations</font>
                        <br />
                        <asp:TreeView ID="tvOrganization" ShowLines="true" EnableClientScript="true" PopulateNodesFromClient="false"
                            SelectedNodeStyle-Font-Bold="true" SelectedNodeStyle-ForeColor="Black" runat="server"
                            OnTreeNodePopulate="TVOrganization_TreeNodePopulate" OnSelectedNodeChanged="tvOrganization_SelectedNodeChanged" />
                        <br />
                        <asp:LinkButton ID="lnkAddOrg" CausesValidation="false" runat="server" CssClass="lnkButton"
                            OnClick="lnkAddOrg_Click">Add a New Organization</asp:LinkButton>
                    </td>
                    <td valign="top">
                        <asp:Panel ID="pnlManageOrg" runat="server" Visible="false">
                            <table>
                                <tr style="height: 13px">
                                    <asp:Label runat="server" ID="lblActionType" Style="font-weight: bold;"></asp:Label>
                                </tr>
                                <tr>
                                    <td>
                                        <table cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td style="width:100px">
                                                    Parent Organization
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlOrgParent" runat="server" DataTextField="OrgName" DataValueField="OrgID"
                                                        AppendDataBoundItems="True" Width="164px">
                                                        <asp:ListItem Value="0">Top Level</asp:ListItem>
                                                    </asp:DropDownList>
                                                </td>
                                                <td>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td style="width:100px">
                                                    Organization Name
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtOrgName" CssClass="input" runat="server" AutoCompleteType="none"
                                                        MaxLength="50" Width="160px"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="reqOrgName" runat="server" ControlToValidate="txtOrgName"
                                                        ErrorMessage="Required Field: Organization Name" Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                    <asp:RegularExpressionValidator ID="regOrgName" runat="server" ControlToValidate="txtOrgName"
                                                        ErrorMessage="Invalid Input: Organization Name" ValidationExpression="<%$ AppSettings:OrgNameRegEx %>"
                                                        Display="None"></asp:RegularExpressionValidator>
                                                    <asp:TextBox ID="txtOrgID" Visible="false" ReadOnly="true" runat="server"></asp:TextBox>
                                                </td>
                                                <td>
                                                    &nbsp;&nbsp;Example - Human Resources
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <asp:ValidationSummary ID="vsOrganization" runat="server" HeaderText="Please correct the following:"
                                            ShowMessageBox="true" ShowSummary="false" DisplayMode="BulletList" />
                                        <asp:Button ID="btnSubmit" Text="Submit" OnClick="SubmitClick" CausesValidation="true"
                                            runat="server" />
                                        <asp:Button ID="btnDelete" Text="Delete" OnClientClick="return Confirm('Are you sure you want to delete the selected organization?');"
                                            OnClick="DeleteClick" Visible="false" CausesValidation="false" runat="server" />
                                        <asp:Button ID="btnCancel" Text="Cancel" OnClick="CancelClick" CausesValidation="false"
                                            runat="server" />
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>
